import * as types from '@src/model/actionType';

// 最新区块
const latestBlockState = {
  BlockHash: 'chain1', // 区块hash
  PreBlockHash: 'asdh123123', // 前一个区块hash
  Timestamp: 1606669261, // 时间戳
  BlockHeight: 12, // 区块高度
  TxCount: 1, // 区块交易数量
  ProposalNodeId: 'consensus3-69vkhkyorg', // 提案节点id
};

function latestBlock(state = latestBlockState, action) {
  switch (action.type) {
    case types.latestBlock:
      return { ...state, ...action.payload };
    default:
      return state;
  }
}

export default latestBlock;
